import { SelectControlSchema } from 'amis/lib/renderers/Form/Select'
import amisUtils from '@/components/amis/amisUtils'
import UpmsMenuShowStatusEnum from '@/core/upms/enums/UpmsMenuShowStatusEnum'

class UpmsMenuShowStatusSelectUtils {
	getSchema = (parmas?: SelectControlSchema): SelectControlSchema => {
		const name = parmas?.name ? parmas.name : 'showStatus'
		const label = '显示状态'
		const mergeSchema = Object.assign(
			{
				type: 'select',
				name: name,
				label: label,
				clearable: true,
				options: amisUtils.getSelectOptionsFromBaseEnum(UpmsMenuShowStatusEnum),
			},
			parmas,
		)

		const schema = mergeSchema
		return schema
	}
}

export default new UpmsMenuShowStatusSelectUtils()
